
<script setup lang="ts">
import router from "@/router";

const login = () => {
  router.push('/login')
}
const register = () => {
  router.push('/register')
}
</script>

<template>
  <div class="start-use">
    <div class="button-group">
      <el-button type="primary" class="action-btn" @click="register">
        <router-link to="/login" class="btn-link">注册</router-link>
      </el-button>
      <el-button type="success" class="action-btn" @click="login">
        <router-link to="/register" class="btn-link">登录</router-link>
      </el-button>
    </div>

    <div class="container">
      <h2 class="title animate__animated animate__fadeIn">项目介绍</h2>

      <div class="section card-hover">
        <h3 class="subtitle">鱼籽-代码生成器</h3>
        <div class="content-group">
          <p class="content">所谓代码生成器就是生成代码的自动化程序</p>
          <p class="content">比如：若依管理系统内置的代码生成器</p>
        </div>
      </div>

      <div class="section card-hover">
        <h3 class="subtitle">鱼籽生成器：</h3>
        <ul class="feature-list">
          <li class="feature-item">
            <span class="feature-icon">🚀</span>
            区别于若依代码生成器
          </li>
          <li class="feature-item">
            <span class="feature-icon">🎯</span>
            本生成器可以根据你上传的代码，制作你所上传代码的代码生成器。也就是，造"轮子"的"轮子"
          </li>
        </ul>
      </div>

      <div class="section card-hover">
        <h3 class="subtitle">鱼籽代码生成器</h3>
        <div class="highlight-content">
          <p class="content">本生成器可以根据你上传的代码，制作你所上传代码的代码生成器。也就是，造"轮子"的"轮子"。</p>
          <p class="content">比如：你可以上传一个某外卖项目Java后端源代码，通过这个造轮子的轮子制作"鱼籽"外卖代码生成器</p>
        </div>
      </div>

      <div class="image-wrapper card-hover">
        <img
          src="@/assets/架构图.jpg"
          alt="BI架构图"
          class="bi-image"
          loading="lazy"
        >
      </div>
    </div>

    <div class="footer-content">
      <a
        href="https://gitee.com/wangfenghuan3399/yuzi-generator"
        target="_blank"
        class="footer-link"
      >
        <img
          src="@/assets/gitee.svg"
          alt="Gitee开源仓库"
          class="gitee-logo"
        >
        <span class="footer-text">鱼籽代码生成器-Gitee 开源仓库</span>
      </a>
    </div>
  </div>
</template>

<style scoped lang="less">
// 颜色变量
@primary-color: #409EFF;
@success-color: #67C23A;
@text-primary: #303133;
@text-regular: #606266;
@border-color: #DCDFE6;
@light-bg: #f9fafc;
@hover-bg: rgba(@primary-color, 0.06);

.start-use {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem 0;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3rem;

  .action-btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(@primary-color, 0.2);
    }

    .btn-link {
      color: white;
      text-decoration: none;
      font-weight: 500;
      letter-spacing: 0.5px;
    }
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.title {
  text-align: center;
  font-size: 2.4rem;
  color: @text-primary;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1.2rem;

  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, @primary-color 0%, @success-color 100%);
    border-radius: 4px;
  }
}

.section {
  margin: 2.5rem 0;
  padding: 2.5rem;
  background: white;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(@border-color, 0.3);

  &.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(@primary-color, 0.1);
  }
}

.subtitle {
  color: @text-primary;
  font-size: 1.7rem;
  margin-bottom: 1.8rem;
  padding-left: 1rem;
  border-left: 4px solid @primary-color;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    left: -1px;
    bottom: -5px;
    width: 30%;
    height: 2px;
    background: rgba(@primary-color, 0.3);
  }
}

.content-group {
  line-height: 1.8;

  .content {
    color: @text-regular;
    margin: 1.2rem 0;
    font-size: 1.05rem;
    padding-left: 1rem;
    position: relative;

    &::before {
      content: '•';
      color: @primary-color;
      position: absolute;
      left: 0;
    }
  }
}

.highlight-content {
  background: rgba(@primary-color, 0.04);
  padding: 2rem;
  border-radius: 12px;
  border: 1px dashed rgba(@primary-color, 0.2);

  .content {
    color: @text-regular;
    line-height: 1.9;
    margin: 1.5rem 0;
  }
}

.feature-list {
  padding-left: 0;

  .feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    margin: 1.5rem 0;
    background: rgba(@light-bg, 0.8);
    border-radius: 12px;
    transition: all 0.3s ease;

    &:hover {
      background: @hover-bg;
      transform: translateX(10px);
      box-shadow: 2px 2px 12px rgba(0,0,0,0.05);
    }

    .feature-icon {
      font-size: 1.4rem;
      flex-shrink: 0;
    }
  }
}

.image-wrapper {
  margin: 3rem 0;
  border-radius: 18px;
  overflow: hidden;
  position: relative;

  .bi-image {
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;

    &:hover {
      transform: scale(1.02);
    }
  }
}

.footer-content {
  margin-top: 4rem;
  text-align: center;

  .footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    background: rgba(@primary-color, 0.08);
    transition: all 0.3s ease;

    &:hover {
      background: rgba(@primary-color, 0.15);
      text-decoration: none;

      .footer-text {
        color: @primary-color;
      }
    }

    .gitee-logo {
      width: 24px;
      height: 24px;
    }

    .footer-text {
      color: @text-regular;
      font-weight: 500;
      transition: color 0.3s ease;
    }
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
    margin: 0 1rem;
  }

  .title {
    font-size: 2rem;

    &::after {
      width: 80px;
    }
  }

  .section {
    padding: 1.5rem;
    margin: 2rem 0;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
    gap: 1rem;

    .action-btn {
      width: 80%;
      max-width: 300px;
    }
  }

  .feature-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
</style>
